Skip to content

feat: add platform stats, stream leaderboard and archiving - #901

Open
Sabira2003 wants to merge 1 commit into
ritik4ever:mainfrom
Sabira2003:feat/704-707-715-stats-leaderboard-archive
Open

feat: add platform stats, stream leaderboard and archiving#901
Sabira2003 wants to merge 1 commit into
ritik4ever:mainfrom
Sabira2003:feat/704-707-715-stats-leaderboard-archive

Conversation

@Sabira2003

Copy link
Copy Markdown

Summary

This PR adds platform analytics endpoints and sender-controlled stream archiving.

Platform stats

  • Adds GET /api/stats.

  • Returns:

    • total_streams
    • active_streams
    • completed_streams
    • canceled_streams
    • total_vested_by_asset for USDC and XLM
    • unique_senders
    • unique_recipients
  • Stats reflect the current database state.

  • Adds 60-second caching.

  • Keeps the endpoint public without authentication.

  • Updates the frontend stats widget to consume /api/stats.

Stream leaderboard

  • Adds GET /api/leaderboard.

  • Supports:

    • top_senders
    • top_recipients
    • largest_streams
  • Top senders are ranked by total amount streamed.

  • Top recipients are ranked by total amount received.

  • Largest streams are ranked by totalAmount.

  • Supports a configurable limit, defaulting to 10 and validated between 1 and 50.

  • Adds 5-minute caching.

  • Adds X-Cache response headers for cache HIT/MISS visibility.

Stream archiving

  • Allows a stream sender to archive completed or canceled streams.
  • Archived streams are excluded from default stream listings.
  • GET /api/streams?include_archived=true continues to return archived streams.
  • Archived streams remain accessible through direct stream ID lookup.
  • Archive state is preserved during subsequent stream updates/synchronization.
  • Sender and recipient default listings exclude archived streams.
  • Relevant stream list caches are invalidated when a stream is archived.

Testing

  • git diff --cached --check passes.
  • Backend TypeScript build is currently blocked by pre-existing syntax errors in the existing Soroban createStream() implementation in backend/src/services/streamStore.ts.
  • Frontend dependency installation/build is currently blocked by pre-existing frontend package/lockfile issues.
  • These unrelated repository issues were intentionally left unchanged to keep this PR scoped to the assigned features.

Closes #704
Closes #707
Closes #715

@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

@Hakimziyech18 is attempting to deploy a commit to the ritik4ever's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@Sabira2003 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0a360ed3-6dfe-468a-b908-4405c6645f02


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add stream soft delete (archive) [FEATURE] Add stream leaderboard endpoint [FEATURE] Add platform stats endpoint

2 participants